Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Connect] docs fixes #4384

Merged
merged 10 commits into from
Dec 20, 2024
Merged

Conversation

mludowise-stripe
Copy link
Collaborator

@mludowise-stripe mludowise-stripe commented Dec 19, 2024

Summary

  • README is now included in the StripeConnect docs root page
    Root cause: A placeholder Docs.docc/StripeConnect.md file needed to be included in the project. The build_documentation script copies the README contents into this file and because docc uses xcodebuild, it can only reference it if it's in the project.

  • Fixed anchor tag links that were using incorrect casing
    Root cause: docc is case-sensitive when generating anchor tags from headers, so these links didn't work on the docs site on pages that included the README. The change is compatible with Github as it's case-insensitive.

  • Now generating docs for API gated behind @_spi(ConnectPrivateBeta)
    Docc excludes SPI from docs since it's not public, however adding the @_documentation(visibility: public) fixes the issue. Unfortunately, this needs to be individually added to every SPI-reference to make it generate to docs, not just the enclosing type.

  • Removed deprecation "hack" from build_documentation
    This was a workaround for the following docc bug, which has since been fixed:
    AvailabilityParser marks iOSApplicationExtension, unavailable-annotated properties as universally deprecated swiftlang/swift-docc#450

  • Cleaned up docstring references in Connect
    Various minor fixes to docstrings like formatting the seealso sections using Markdoc.

  • Alphabetized modules on root page

Motivation

https://jira.corp.stripe.com/browse/MXMOBILE-3003

Testing

image image

Changelog

n/a

Copy link

github-actions bot commented Dec 19, 2024

⚠️ Public API changes detected:

StripeConnect

- public var delegate: (any StripeConnect.AccountOnboardingViewControllerDelegate)?
+ @objc deinit
+ func accountOnboardingDidExit(_ accountOnboarding: StripeConnect.AccountOnboardingViewController)
+ func accountOnboarding(_ accountOnboarding: StripeConnect.AccountOnboardingViewController, didFailLoadWithError error: any Swift.Error)
- public func accountOnboardingDidExit(_ accountOnboarding: StripeConnect.AccountOnboardingViewController)
- public func accountOnboarding(_ accountOnboarding: StripeConnect.AccountOnboardingViewController, didFailLoadWithError error: any Swift.Error)

If you are adding a new public API consider the following:

  • Do these APIs need to be public or can they be protected with @_spi(STP)?
  • If these APIs need to be public, assess whether they require an API review.

If you are modifying or removing a public API:

  • Does this require a breaking version change?
  • Do these changes require API review?

If you confirm these APIs need to be added/updated and have undergone necessary review, add the label modifies public API to this PR to acknowledge and bypass this check.

ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with master.

@mludowise-stripe mludowise-stripe force-pushed the mludowise/MXMOBILE-3003_docs_readme branch 2 times, most recently from b2e9b68 to 3300603 Compare December 20, 2024 01:42
@mludowise-stripe mludowise-stripe changed the title [Connect] fix StripeConnect in docs [Connect] fix docs Dec 20, 2024
@mludowise-stripe mludowise-stripe changed the title [Connect] fix docs [Connect] docs fixes Dec 20, 2024
@mludowise-stripe mludowise-stripe force-pushed the mludowise/MXMOBILE-3003_docs_readme branch from c4bb6ab to 11bc356 Compare December 20, 2024 04:20
Comment on lines +99 to 108
@_documentation(visibility: public)
public extension AccountOnboardingViewControllerDelegate {
// Add default implementation of delegate methods to make them optional

@_documentation(visibility: public)
func accountOnboardingDidExit(_ accountOnboarding: AccountOnboardingViewController) { }

@_documentation(visibility: public)
func accountOnboarding(_ accountOnboarding: AccountOnboardingViewController,
didFailLoadWithError error: Error) { }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were all needed so docc would mark them as "Default implementation provided"

podspec = Pod::Specification.from_file(File.join_if_safe($ROOT_DIR, m['podspec']))
index_content += "**[#{podspec.name}](../../#{m['framework_name'].downcase}/documentation/#{m['framework_name'].downcase})**\n\n#{podspec.summary}\n\n"
modules
.sort_by { |m| m['framework_name'] }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetizes the root page

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: StringCodingKey.self)
try container.encode(appearance.asDictionary(traitCollection: traitCollection), forKey: StringCodingKey("variables"))
func encode(to encoder: Encoder) throws {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the struct is internal, no need to make this function public

var baseURL: URL = StripeConnectConstants.connectJSBaseURL

var publicKeyOverride: String? = nil

var publicKeyOverride: String?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linter autofix

@mludowise-stripe mludowise-stripe merged commit ce94bb7 into master Dec 20, 2024
7 checks passed
@mludowise-stripe mludowise-stripe deleted the mludowise/MXMOBILE-3003_docs_readme branch December 20, 2024 20:49
mludowise-stripe added a commit that referenced this pull request Dec 20, 2024
Updates 2.24.0 docs with fixes from #4384

Co-authored-by: Bitrise CI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants